package io.commchina.utils;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @ClassName QQConstantPropertiesUtil
 * @Description: 获取配置文件中的值（spring容器中的属性值）
 * @Author: jnyou
 **/
@Component
public class QQConstantPropertiesUtil implements InitializingBean {

    @Value("${qq.open.app_id}")
    private String appId;

    @Value("${qq.open.app_secret}")
    private String appSecret;

    @Value("${qq.open.redirect_url}")
    private String redirectUrl;

    public static String QQ_OPEN_APP_ID;
    public static String QQ_OPEN_APP_SECRET;
    public static String QQ_OPEN_REDIRECT_URL;

    @Override
    public void afterPropertiesSet() throws Exception {
        QQ_OPEN_APP_ID = appId;
        QQ_OPEN_APP_SECRET = appSecret;
        QQ_OPEN_REDIRECT_URL = redirectUrl;
    }
}